<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>解决kindeditor与Struts2框架整合时无法上传本地图片的问题 - Alinaxz的专栏 - 博客频道 - CSDN.NET</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="由于struts框架对request对象做了封装，原来处理上传图片的upload_json.jsp文件无法使用了，于是对kindeditor中处理上传图片的upload_json.jsp文件进行重写，通过多次测试后，成功实现了图片的上传。&#160;@ page language=jav" />
<script src="http://static.blog.csdn.net/scripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript" src="http://static.blog.csdn.net/scripts/ad.js?v=1.1"></script>
<link rel="Stylesheet" type="text/css" href="http://static.blog.csdn.net/skin/default/css/style.css?v=1.1" />
<link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="/Alinaxz/rss/list" />
<link rel="shortcut icon" href="/favicon.ico" />
<link type="text/css" rel="stylesheet" href="http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/default.css" />
</head>
<body>
<script src="http://csdnimg.cn/pubnav/js/pub_topnav_2011.js?v=1.1" type="text/javascript"></script>
<div id="container">
<div id="header">
    <div class="header">
        <div id="blog_title">
            <h1><a href="/Alinaxz">Alinaxz的专栏</a></h1>
            <h2></h2>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<div id="navigator">
    <div class="navigator_bg"></div>
    <div class="navigator">
        <ul>
            <li id="btnContents"><a href="/Alinaxz?viewmode=contents"><span><img src="http://static.blog.csdn.net/images/ico_list.gif">目录视图</span></a></li>
            <li id="btnView"><a href="/Alinaxz?viewmode=list"><span><img src="http://static.blog.csdn.net/images/ico_summary.gif">摘要视图</span></a></li>
            <li id="btnRss"><a href="/Alinaxz/rss/list"><span><img src="http://static.blog.csdn.net/images/ico_rss.gif">订阅</span></a></li>
</ul>
    </div>
</div>
<script type="text/javascript">
    var username = "Alinaxz";
    var blog_address = "http://blog.csdn.net/alinaxz";
    var static_host = "http://static.blog.csdn.net";
    var currentUserName = "";
</script>
        
<div id="body">
<div id="main">
<div class="main">
<div class="notice"> 

<a href="http://blog.csdn.net/blogdevteam/article/details/8687376
" target="_blank">
<font color=red>2013年7月微软MVP申请开始啦！ 
   </font></a>



&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://blog.csdn.net/blogdevteam/article/details/8664620" target="_blank"><font color=blue>CSDN博客移动开发排行榜 
</font></a>

&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://blog.csdn.net/blogdevteam/article/details/8699892" target="_blank"><font color=blue>写“书评”赢下载分！ 


</font></a>

<br />





<a href="http://blog.csdn.net/blogdevteam/article/details/8754544"target="_blank">
<font color=blue>2013年4月微软MVP会员名单揭晓！


 </font></a>

&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://blog.csdn.net/blogdevteam/article/details/8717564"target="_blank">
<font color=red>来极客头条，赢下载积分
 </font></a>



&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://www.csdn.net/article/2013-04-02/2814746"target="_blank">
<font color=red>专访关东升：将人文融入到科技产品中

 </font></a>






</div><div id="article_details" class="details">
    <div class="article_title">
    <span class="ico ico_type_Original"></span>
    <h3>
        <span class="link_title"><a href="/alinaxz/article/details/6597516">
        解决kindeditor与Struts2框架整合时无法上传本地图片的问题
        </a></span>
    </h3>
</div>

        
    <div class="article_manage">
        <span class="link_categories">
        分类：
            <a href="/Alinaxz/article/category/293908">学习笔记</a> 
            <a href="/Alinaxz/article/category/845385">struts2</a> 
        </span>
    <span class="link_postdate">2011-07-11 13:59</span>
    <span class="link_view" title="阅读次数">1401人阅读</span>
    <span class="link_comments" title="评论次数"><a href="#comments">评论</a>(1)</span>
    <span class="link_collect"><a href="javascript:void(0);" onclick="javascript:collectArticle('解决kindeditor与Struts2框架整合时无法上传本地图片的问题','6597516');return false;" title="收藏">收藏</a></span>
    <span class="link_report"><a href="#report"  onclick="javascript:report(6597516,2);return false;" title="举报">举报</a></span>
    
</div>
<div class="tag2box"><a href='http://blog.csdn.net/tag/details.html?tag=struts' target=_blank>struts</a><a href='http://blog.csdn.net/tag/details.html?tag=%e6%a1%86%e6%9e%b6' target=_blank>框架</a><a href='http://blog.csdn.net/tag/details.html?tag=string' target=_blank>string</a><a href='http://blog.csdn.net/tag/details.html?tag=import' target=_blank>import</a><a href='http://blog.csdn.net/tag/details.html?tag=upload' target=_blank>upload</a><a href='http://blog.csdn.net/tag/details.html?tag=myeclipse' target=_blank>myeclipse</a></div>


    
<div id="article_content" class="article_content">
<div class="bbs-content"><p></p><div class="blog_content"><span style="font-size:16px;"><strong>一 环境: XP3+Myeclipse6.6+Tomcat7 <br />二 官网:<a href="http://www.kindsoft.net/" target="_blank"><span style="color:#e9650e;">http://www.kindsoft.net/</span></a> </strong></span><span style="font-size:16px;"><br />需要的jar文件如下 :&nbsp; </span></div><div class="blog_content"><span style="font-size:16px;">commons-fileupload-1.2.1.jar</span></div><div class="blog_content"><span style="font-size:16px;">commons-io-1.4.jar</span></div><div class="blog_content"><span style="font-size:16px;">json_simple-1.1.jar<br /><strong>三 参考资料 </strong><br />1 可视化编辑器的开发心得 <br /><a href="http://www.javaeye.com/topic/552177" target="_blank"><span style="color:#e9650e;">http://www.javaeye.com/topic/552177</span></a> </span><span style="font-size:16px;"><br />2 KindEditor使用 <br /><a href="http://jonney-82.javaeye.com/blog/447579" target="_blank"><span style="color:#e9650e;">http://jonney-82.javaeye.com/blog/447579</span></a> </span><span style="font-size:16px;"><br />3 kindeditor错误“服务器发生故障”解决的办法！ <br /><a href="http://www.webqi.cn/news/news179.html" target="_blank"><span style="color:#e9650e;">http://www.webqi.cn/news/news179.html</span></a> </span><span style="font-size:16px;"><br />4 基于kindeditor3.4的上传功能的JAVA实现 <br /><a href="http://www.javaeye.com/topic/599971" target="_blank"><span style="color:#e9650e;">http://www.javaeye.com/topic/599971</span></a> </span><span style="font-size:16px;"><strong><br />四 具体代码:版本:Kindeditor3.5 </strong><br />1 参考(kindeditor错误“服务器发生故障”解决的办法！)所讲述问题修改二个文件,就不用每个页面都要设置:imageUploadJson,fileManagerJson这二个参数. <br />修改位置与文件名称 <br /><span style="background-color: rgb(255, 255, 153);">1 </span><strong style="background-color: rgb(255, 255, 153);">kindeditor/plugins/image/image.html </strong><br />将其中的: <br /></span></div><div class="dp-highlighter"><div class="bar"><div class="tools"><span style="font-size:16px;">Js代码 </span></div></div><ol class="dp-c"><li><span style="font-size:16px;"><span><span class="keyword"><strong><span style="color:#7f0055;">var</span></strong></span><span>&nbsp;imageUploadJson&nbsp;=&nbsp;(</span><span class="keyword"><strong><span style="color:#7f0055;">typeof</span></strong></span><span>&nbsp;KE.g[id].imageUploadJson&nbsp;==&nbsp;</span><span class="string"><span style="color:#0000ff;">'undefined'</span></span><span>)&nbsp;?&nbsp;</span><span class="string"><span style="color:#0000ff;">'../../php/upload_json.php'</span></span><span>&nbsp;:&nbsp;KE.g[id].imageUploadJson;&nbsp;&nbsp;</span></span></span></li></ol></div><div class="blog_content"><span style="font-size:16px;"><br />就是把:</span><span style="font-size:16px;color:red;">php替换成:jsp</span><span style="font-size:16px;">,修改为: <br /></span></div><div class="dp-highlighter"><div class="bar"><div class="tools"><span style="font-size:16px;">Js代码 </span></div></div><ol class="dp-c"><li><span style="font-size:16px;"><span><span class="keyword"><strong><span style="color:#7f0055;">var</span></strong></span><span>&nbsp;imageUploadJson&nbsp;=&nbsp;(</span><span class="keyword"><strong><span style="color:#7f0055;">typeof</span></strong></span><span>&nbsp;KE.g[id].imageUploadJson&nbsp;==&nbsp;</span><span class="string"><span style="color:#0000ff;">'undefined'</span></span><span>)&nbsp;?&nbsp;</span><span class="string"><span style="color:#0000ff;">'../../jsp/upload_json.jsp'</span></span><span>&nbsp;:&nbsp;KE.g[id].imageUploadJson;&nbsp;&nbsp;</span></span></span></li></ol></div><div class="blog_content"><span style="font-size:16px;"><br style="background-color: rgb(255, 255, 153);" /><span style="background-color: rgb(255, 255, 153);">2</span><strong style="background-color: rgb(255, 255, 153);"> kindeditor/plugins/file_manager/file_manager.js </strong><br /></span></div><div class="dp-highlighter"><div class="bar"><div class="tools"><span style="font-size:16px;">Js代码 </span></div></div><ol class="dp-c"><li><span style="font-size:16px;"><span><span class="keyword"><strong><span style="color:#7f0055;">var</span></strong></span><span>&nbsp;JSON_URL&nbsp;=&nbsp;</span><span class="string"><span style="color:#0000ff;">'../../php/file_manager_json.php'</span></span><span>;&nbsp;&nbsp;</span></span></span></li></ol></div><div class="blog_content"><span style="font-size:16px;"><br /></span></div><div class="dp-highlighter"><div class="bar"><div class="tools"><span style="font-size:16px;">Java代码&nbsp;&nbsp;</span></div></div><ol class="dp-j"><li><span style="font-size:16px;"><span><span>var&nbsp;JSON_URL&nbsp;=&nbsp;</span><span class="string"><span style="color:#0000ff;">'../../jsp/file_manager_json.jsp'</span></span><span>;&nbsp; <br /></span></span></span></li></ol></div><span style="font-size:16px;"><br /></span><p></p><p><span style="font-size:16px;"><strong>由于struts框架对request对象做了封装，原来处理上传图片的upload_json.jsp文件无法使用了，于是对kindeditor中处理上传图片的upload_json.jsp文件进行重写，通过多次测试后，成功实现了图片的上传。</strong></span></p><p><span style="font-size:16px;">&nbsp;</span></p><pre class="prettyprint"><span style="font-size:13px;"><span class="pun">&lt;%</span><span class="pln">@ page language</span><span class="pun">=</span><span class="str">&quot;java&quot;</span><span class="pln"> contentType</span><span class="pun">=</span><span class="str">&quot;text/html; charset=UTF-8&quot;</span><span class="pln"> pageEncoding</span><span class="pun">=</span><span class="str">&quot;UTF-8&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;java.util.*,java.io.*&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;java.text.SimpleDateFormat&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;org.apache.commons.fileupload.*&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;org.apache.commons.fileupload.disk.*&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;org.apache.commons.fileupload.servlet.*&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;com.opensymphony.xwork2.ActionContext&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper&quot;</span><span class="pun">%&gt;</span><span class="pln">
　　　　</span><span class="pun">&lt;%</span><span class="pln">@ page </span><span class="kwd">import</span><span class="pun">=</span><span class="str">&quot;org.json.simple.*&quot;</span><span class="pun">%&gt;</span><span class="pln">

　　　　</span><span class="pun">&lt;%</span><span class="pln">
　　　　　</span><span class="com">//文件保存目录路径 img_upload是服务器存储上传图片的目录名</span><span class="pln">
　　　　</span><span class="typ">String</span><span class="pln"> savePath </span><span class="pun">=</span><span class="pln"> request</span><span class="pun">.</span><span class="pln">getSession</span><span class="pun">().</span><span class="pln">getServletContext</span><span class="pun">().</span><span class="pln">getRealPath</span><span class="pun">(</span><span class="str">&quot;/&quot;</span><span class="pun">)+</span><span class="pln"> </span><span class="str">&quot;img_upload/&quot;</span><span class="pun">;</span><span class="pln">

　　　　　　　　</span><span class="com">//文件保存目录URL</span><span class="pln">
　　　　　　　　</span><span class="typ">String</span><span class="pln"> saveUrl </span><span class="pun">=</span><span class="pln"> request</span><span class="pun">.</span><span class="pln">getContextPath</span><span class="pun">()</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">&quot;/img_upload/&quot;</span><span class="pun">;</span><span class="pln">

　　　　　　　　</span><span class="com">//定义允许上传的文件扩展名</span><span class="pln">
　　　　　　　　</span><span class="typ">String</span><span class="pun">[]</span><span class="pln"> fileTypes </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">String</span><span class="pun">[]</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">&quot;gif&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;jpg&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;jpeg&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="str">&quot;png&quot;</span><span class="pun">,</span><span class="str">&quot;bmp&quot;</span><span class="pln"> </span><span class="pun">};</span><span class="pln">

　　　　　　　　</span><span class="com">//允许最大上传文件大小</span><span class="pln">
　　　　　　　　</span><span class="kwd">long</span><span class="pln"> maxSize </span><span class="pun">=</span><span class="pln"> </span><span class="lit">1024000</span><span class="pun">;</span><span class="pln">

　　　　　　　　</span><span class="com">//Struts2 请求 包装过滤器</span><span class="pln">
　　　　　　　　</span><span class="typ">MultiPartRequestWrapper</span><span class="pln"> wrapper </span><span class="pun">=</span><span class="pln"> </span><span class="pun">(</span><span class="typ">MultiPartRequestWrapper</span><span class="pun">)</span><span class="pln"> request</span><span class="pun">;</span><span class="pln">

　　　　　　　　</span><span class="com">//获得上传的文件名</span><span class="pln">
　　　　　　　　</span><span class="typ">String</span><span class="pln"> fileName </span><span class="pun">=</span><span class="pln"> wrapper</span><span class="pun">.</span><span class="pln">getFileNames</span><span class="pun">(</span><span class="str">&quot;imgFile&quot;</span><span class="pun">)[</span><span class="lit">0</span><span class="pun">];</span><span class="pln">

　　　　　　　　</span><span class="com">//获得文件过滤器</span><span class="pln">
　　　　　　　　</span><span class="typ">File</span><span class="pln"> file </span><span class="pun">=</span><span class="pln"> wrapper</span><span class="pun">.</span><span class="pln">getFiles</span><span class="pun">(</span><span class="str">&quot;imgFile&quot;</span><span class="pun">)[</span><span class="lit">0</span><span class="pun">];</span><span class="pln">

　　　　　　　　</span><span class="com">//得到上传文件的扩展名</span><span class="pln">
　　　　　</span><span class="typ">String</span><span class="pln"> fileExt </span><span class="pun">=</span><span class="pln"> fileName</span><span class="pun">.</span><span class="pln">substring</span><span class="pun">(</span><span class="pln">fileName</span><span class="pun">.</span><span class="pln">lastIndexOf</span><span class="pun">(</span><span class="str">&quot;.&quot;</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">).</span><span class="pln">toLowerCase</span><span class="pun">();</span><span class="pln">

　　　　　　　　</span><span class="com">//检查扩展名</span><span class="pln">
　　　　　　　　</span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(!</span><span class="typ">Arrays</span><span class="pun">.&lt;</span><span class="typ">String</span><span class="pun">&gt;</span><span class="pln"> asList</span><span class="pun">(</span><span class="pln">fileTypes</span><span class="pun">).</span><span class="pln">contains</span><span class="pun">(</span><span class="pln">fileExt</span><span class="pun">))</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 </span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">getError</span><span class="pun">(</span><span class="str">&quot;上传文件扩展名是不允许的扩展名。&quot;</span><span class="pun">));</span><span class="pln">
　　　　　　　　 </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln">
　　　　　　　　</span><span class="com">//检查文件大小</span><span class="pln">
　　　　　　　　</span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">file</span><span class="pun">.</span><span class="pln">length</span><span class="pun">()</span><span class="pln"> </span><span class="pun">&gt;</span><span class="pln"> maxSize</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 </span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">getError</span><span class="pun">(</span><span class="str">&quot;上传文件大小超过限制。&quot;</span><span class="pun">));</span><span class="pln">
　　　　　　　　 </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln"> 

　　　　　　　　</span><span class="com">//检查目录</span><span class="pln">
　　　　　　　　</span><span class="typ">File</span><span class="pln"> uploadDir </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">File</span><span class="pun">(</span><span class="pln">savePath</span><span class="pun">);</span><span class="pln">
　　　　　　　　</span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(!</span><span class="pln">uploadDir</span><span class="pun">.</span><span class="pln">isDirectory</span><span class="pun">())</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 </span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">getError</span><span class="pun">(</span><span class="str">&quot;上传目录不存在。&quot;</span><span class="pun">));</span><span class="pln">
　　　　　　　　 </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln">
　　　　　　　　</span><span class="com">//检查目录写入权限</span><span class="pln">
　　　　　　　　</span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(!</span><span class="pln">uploadDir</span><span class="pun">.</span><span class="pln">canWrite</span><span class="pun">())</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 </span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">getError</span><span class="pun">(</span><span class="str">&quot;上传目录没有写入权限。&quot;</span><span class="pun">));</span><span class="pln">
　　　　　　　　 </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln">

　　　　　　　　</span><span class="com">//重构上传图片的名称 </span><span class="pln">
　　　　　　　　</span><span class="typ">SimpleDateFormat</span><span class="pln"> df </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">SimpleDateFormat</span><span class="pun">(</span><span class="str">&quot;yyyyMMddHHmmss&quot;</span><span class="pun">);</span><span class="pln">
　　　　　　　　</span><span class="typ">String</span><span class="pln"> newImgName </span><span class="pun">=</span><span class="pln"> df</span><span class="pun">.</span><span class="pln">format</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Date</span><span class="pun">())</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">&quot;_&quot;</span><span class="pun">
                              +</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Random</span><span class="pun">().</span><span class="pln">nextInt</span><span class="pun">(</span><span class="lit">1000</span><span class="pun">)</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">&quot;.&quot;</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> fileExt</span><span class="pun">;</span><span class="pln">

　　　　　　　　</span><span class="com">//设置 KE 中的图片文件地址</span><span class="pln">
　　　　</span><span class="typ">String</span><span class="pln"> newFileName </span><span class="pun">=</span><span class="pln"> request</span><span class="pun">.</span><span class="pln">getScheme</span><span class="pun">()</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">&quot;://&quot;</span><span class="pun">+</span><span class="pln"> request</span><span class="pun">.</span><span class="pln">getServerName</span><span class="pun">()</span><span class="pln"> </span><span class="pun">
                        +</span><span class="pln"> </span><span class="str">&quot;:&quot;</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> request</span><span class="pun">.</span><span class="pln">getServerPort</span><span class="pun">()</span><span class="pln">
　　　　　　　　</span><span class="pun">+</span><span class="pln"> saveUrl </span><span class="pun">+</span><span class="pln"> newImgName</span><span class="pun">;</span><span class="pln">

　　　　　　　　</span><span class="kwd">byte</span><span class="pun">[]</span><span class="pln"> buffer </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="kwd">byte</span><span class="pun">[</span><span class="lit">1024</span><span class="pun">];</span><span class="pln">

　　　　　　　　</span><span class="com">//获取文件输出流</span><span class="pln">
　　　　　　　　</span><span class="typ">FileOutputStream</span><span class="pln"> fos </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">FileOutputStream</span><span class="pun">(</span><span class="pln">savePath </span><span class="pun">+</span><span class="pln"> newImgName</span><span class="pun">);</span><span class="pln">

　　　　　　　　</span><span class="com">//获取内存中当前文件输入流</span><span class="pln">
　　　　　　　　</span><span class="typ">InputStream</span><span class="pln"> </span><span class="kwd">in</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">FileInputStream</span><span class="pun">(</span><span class="pln">file</span><span class="pun">);</span><span class="pln">

　　　　　　　　</span><span class="kwd">try</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="kwd">int</span><span class="pln"> num </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln">
　　　　　　　　　　 </span><span class="kwd">while</span><span class="pln"> </span><span class="pun">((</span><span class="pln">num </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">in</span><span class="pun">.</span><span class="pln">read</span><span class="pun">(</span><span class="pln">buffer</span><span class="pun">))</span><span class="pln"> </span><span class="pun">&gt;</span><span class="pln"> </span><span class="lit">0</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 &nbsp; &nbsp; &nbsp; &nbsp; fos</span><span class="pun">.</span><span class="pln">write</span><span class="pun">(</span><span class="pln">buffer</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> num</span><span class="pun">);</span><span class="pln">
　　　　　　　　 </span><span class="pun">}</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">Exception</span><span class="pln"> e</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 &nbsp; &nbsp; &nbsp; &nbsp;e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">(</span><span class="typ">System</span><span class="pun">.</span><span class="pln">err</span><span class="pun">);</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln"> </span><span class="kwd">finally</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　 &nbsp; &nbsp; &nbsp;　 &nbsp;</span><span class="kwd">in</span><span class="pun">.</span><span class="pln">close</span><span class="pun">();</span><span class="pln">
　　　　　　　　 &nbsp; &nbsp; &nbsp; &nbsp;fos</span><span class="pun">.</span><span class="pln">close</span><span class="pun">();</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln">

　　　　　　　　</span><span class="com">//发送给 KE </span><span class="pln">

　　　　　　　　</span><span class="typ">JSONObject</span><span class="pln"> obj </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JSONObject</span><span class="pun">();</span><span class="pln">
　　　　　　　　obj</span><span class="pun">.</span><span class="pln">put</span><span class="pun">(</span><span class="str">&quot;error&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">);</span><span class="pln">
　　　　　　　　obj</span><span class="pun">.</span><span class="pln">put</span><span class="pun">(</span><span class="str">&quot;url&quot;</span><span class="pun">,</span><span class="pln"> saveUrl </span><span class="pun">+</span><span class="pln"> newImgName</span><span class="pun">);</span><span class="pln">
　　　　　　　　</span><span class="kwd">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">obj</span><span class="pun">.</span><span class="pln">toJSONString</span><span class="pun">());</span><span class="pln">
　　　　　　　　</span><span class="pun">%&gt;</span><span class="pln">
　　　　　　　　</span><span class="pun">&lt;%!</span><span class="kwd">private</span><span class="pln"> </span><span class="typ">String</span><span class="pln"> getError</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> message</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
　　　　　　　　 </span><span class="typ">JSONObject</span><span class="pln"> obj </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JSONObject</span><span class="pun">();</span><span class="pln">
　　　　　　　　 obj</span><span class="pun">.</span><span class="pln">put</span><span class="pun">(</span><span class="str">&quot;error&quot;</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">);</span><span class="pln">
　　　　　　　　 obj</span><span class="pun">.</span><span class="pln">put</span><span class="pun">(</span><span class="str">&quot;message&quot;</span><span class="pun">,</span><span class="pln"> message</span><span class="pun">);</span><span class="pln">
　　　　　　　　 </span><span class="kwd">return</span><span class="pln"> obj</span><span class="pun">.</span><span class="pln">toJSONString</span><span class="pun">();</span><span class="pln">
　　　　　　　　</span><span class="pun">}</span><span class="pln">
　　　　　</span><span class="pun">%&gt;</span></span></pre></div><p><span style="font-size:16px;"><br /></span></p><p><span style="font-size:16px;"><br /></span></p><p><span style="font-size:16px;">或</span></p><p><span style="font-size:16px;"><br /></span></p><p><span style="font-size:16px;">修改web.xml文件中有关action路径就可以了！如下，</span></p><p><span style="font-size:16px;">&nbsp; &lt;filter-mapping&gt;&nbsp;&nbsp; <br />&nbsp; &nbsp;&nbsp;&nbsp; &lt;filter-name&gt;struts2&lt;/filter-name&gt;&nbsp;&nbsp; <br />&nbsp; &nbsp;&nbsp;&nbsp; &lt;url-pattern&gt;*.action&lt;/url-pattern&gt;&nbsp;&nbsp; <br />&nbsp; &lt;/filter-mapping&gt;</span></p><p><span style="font-size:16px;">就可以正常得到request中的内容</span></p><span style="font-size:16px;"><br /></span>
</div>
<div class="share_buttons" id="sharePanel"></div>
<!--192.168.1.236-->
<div class="article_next_prev">
    <li class="prev_article"><span>上一篇：</span><a href="/alinaxz/article/details/5511885">Eclipse 3.5 中的jvm terminated.Exit code=-1错误的解决</a></li>
    <li class="next_article"><span>下一篇：</span><a href="/alinaxz/article/details/6597694">struts2自定义分页标签</a></li>
</div>


    
</div>
<div id="ad_cen"></div>
<script type="text/javascript">
    new Ad(4, 'ad_cen');
</script>
<div id="comment_title" class="panel_head">查看评论<a name="comments"></a></div>
<div id="comment_list"></div>
<div id="comment_bar"></div>
<div id="comment_form"></div>
<div class="announce">* 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场<a name="reply"></a><a name="quote"></a></div>
<script type="text/javascript">
    var fileName = '6597516';
    var commentscount = 1;
    var islock = false
</script>
<script type="text/javascript" src="http://static.blog.csdn.net/scripts/comment.js?v=1.8"></script>
<div id="ad_bot"></div>
<script type="text/javascript">
    new Ad(5, 'ad_bot');
</script>
<div id="report_dialog"></div>

<div id="d-top" style="display:none;">
<a id="d-top-a" href="#" title="回到顶部">
<img src="http://static.blog.csdn.net/images/top.png" alt="TOP" /></a>
</div>
<script type="text/javascript">
    $(function(){
        var d_top=$('#d-top');
        document.onscroll=function(){
            var scrTop=(document.body.scrollTop||document.documentElement.scrollTop);
            if(scrTop>500){
                d_top.show();
            }else{
                d_top.hide();
            }
        }
        $('#d-top-a').click(function(){
            scrollTo(0,0);
            this.blur();
            return false;
        });
    });
</script>



<div class="clear"></div>
</div>
</div>

<div id="side">
<div class="side">
<div id="panel_Profile" class="panel">
    <ul class="panel_head"><span>个人资料</span></ul>
    <ul class="panel_body profile">
        <div id="blog_userface">
            <a href="http://my.csdn.net/Alinaxz" target="_blank">
            <img src="http://avatar.csdn.net/9/A/F/1_alinaxz.jpg" title="访问我的空间" style="max-width:90%"/>
            </a>
            <br />
            <span><a href="http://my.csdn.net/Alinaxz" class="user_name" target="_blank">Alinaxz</a></span>
        </div>
<div class="interact">
<!--<a href="#" class="attented" title="已关注"></a>-->
<a href="javascript:void(0);" class="attent" id="span_add_follow" title="[加关注]"></a>
<a href="javascript:void(0);" class="letter" onclick="loginto(1)" title="[发私信]"></a>
</div>
        <div id="blog_medal">
        </div>
        <ul id="blog_rank">
            <li>访问：<span>91077次</span></li>
            <li>积分：<span>1398分</span></li>
            <li>排名：<span>第6289名</span></li>
        </ul>
        <ul id="blog_statistics">
            <li>原创：<span>36篇</span></li>
            <li>转载：<span>81篇</span></li>
            <li>译文：<span>0篇</span></li>
            <li>评论：<span>34条</span></li>
        </ul>
    </ul>
</div>
<script type="text/javascript">
    var _blogger = 'Alinaxz';
</script>



<div class="panel" id="panel_Search">
    <ul class="panel_head"><span>文章搜索</span></ul>
    <ul class="panel_body">
        <form id="frmSearch" action="http://so.csdn.net/search" class="form_search" target="_blank">
        <span><input id="inputSearch" type="text" class="blogsearch" title="请输入关键字" /></span>
        <input id="btnSubmit" type="submit" value="搜索" title="search in blog" />
        <input type="hidden" name="q" id="inputQ" />
        <input type="hidden" name="t" value="blog" />
        <a id="btnSearchBlog" target="_blank"></a>
        </form>
    </ul>
</div><div id="panel_Category" class="panel">
    <ul class="panel_head"><span>文章分类</span></ul>
    <ul class="panel_body">
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/677199">Android</a><span>(5)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/373592">Oracle</a><span>(9)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/640199">QTP</a><span>(6)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/487552">Testing</a><span>(13)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/620197">休闲娱乐</a><span>(1)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/293908">学习笔记</a><span>(69)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/293886">异常处理</a><span>(5)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/845385">struts2</a><span>(6)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/845388">jquery</a><span>(23)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/845649">js</a><span>(4)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/845670">css</a><span>(2)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/846805">memcache</a><span>(2)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/849918">开发工具</a><span>(4)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/850355">spring</a><span>(11)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/855772">jstl</a><span>(1)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/893807">webservice</a><span>(5)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/1075414">abap</a><span>(10)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/alinaxz/article/category/1075416">sap</a><span>(10)</span>
        </li>
    </ul>
</div><div id="panel_Archive" class="panel">
    <ul class="panel_head"><span>文章存档</span></ul>
    <ul class="panel_body">
        <div id="archive_list">
        <!--归档统计-->
        <li><a href="http://blog.csdn.net/alinaxz/article/month/2012/09">2012年09月</a><span>(3)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2012/08">2012年08月</a><span>(3)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2012/02">2012年02月</a><span>(11)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2012/01">2012年01月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2011/12">2011年12月</a><span>(2)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2011/11">2011年11月</a><span>(2)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2011/10">2011年10月</a><span>(2)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2011/09">2011年09月</a><span>(7)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2011/08">2011年08月</a><span>(10)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2011/07">2011年07月</a><span>(40)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2010/04">2010年04月</a><span>(6)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2010/01">2010年01月</a><span>(5)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2009/11">2009年11月</a><span>(9)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2009/09">2009年09月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2009/08">2009年08月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2009/07">2009年07月</a><span>(2)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2009/03">2009年03月</a><span>(2)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2008/11">2008年11月</a><span>(3)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2008/03">2008年03月</a><span>(3)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2008/01">2008年01月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/alinaxz/article/month/2007/04">2007年04月</a><span>(3)</span></li>
        </div>
    </ul>
</div>
<div id="hotarticls" class="panel">
    <ul class="panel_head"><span>阅读排行</span></ul>
    <ul class="panel_body itemlist">
        <li>
            <a href="/alinaxz/article/details/5503214" title="Android初学者常见问题解析（1）">Android初学者常见问题解析（1）</a><span>(12028)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/5503463" title="android 保存图片到数据库">android 保存图片到数据库</a><span>(5673)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6643873" title="Spring MVC 学习笔记 九 json格式的输入和输出">Spring MVC 学习笔记 九 json格式的输入和输出</a><span>(4360)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6635796" title="js 字符串转日期并比较大小(附其它操作)">js 字符串转日期并比较大小(附其它操作)</a><span>(3237)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6626588" title="第一个jqGrid的demo">第一个jqGrid的demo</a><span>(3092)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/1565818" title="java.lang.IllegalStateException: Cannot forward after response has been committed异常">java.lang.IllegalStateException: Cannot forward after response has been committed异常</a><span>(3019)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6671614" title="js 代码实现onchange事件">js 代码实现onchange事件</a><span>(2169)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6622912" title="springmvc Spring3 MVC @ResponseBody返回，jquery ajax调用中文乱码问题解决">springmvc Spring3 MVC @ResponseBody返回，jquery ajax调用中文乱码问题解决</a><span>(2017)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/4038697" title="PLSQL中over(partition by .. order by ..)的使用  ">PLSQL中over(partition by .. order by ..)的使用  </a><span>(2005)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6638674" title="jqGrid 问题笔记">jqGrid 问题笔记</a><span>(1781)</span>
        </li>
    </ul>
</div>
<div id="hotarticls2" class="panel">
    <ul class="panel_head"><span>评论排行</span></ul>
    <ul class="panel_body itemlist">
        <li>
            <a href="/alinaxz/article/details/5503214" title="Android初学者常见问题解析（1）">Android初学者常见问题解析（1）</a><span>(7)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6804818" title="MyEclipse6.5上基于JAX-WS开发Webservice">MyEclipse6.5上基于JAX-WS开发Webservice</a><span>(3)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/1565818" title="java.lang.IllegalStateException: Cannot forward after response has been committed异常">java.lang.IllegalStateException: Cannot forward after response has been committed异常</a><span>(2)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/4038697" title="PLSQL中over(partition by .. order by ..)的使用  ">PLSQL中over(partition by .. order by ..)的使用  </a><span>(2)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6631326" title="jqgrid属性方法">jqgrid属性方法</a><span>(2)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6632472" title="spring mvc中的页面跳转">spring mvc中的页面跳转</a><span>(2)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/5503463" title="android 保存图片到数据库">android 保存图片到数据库</a><span>(2)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/6638674" title="jqGrid 问题笔记">jqGrid 问题笔记</a><span>(1)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/5129879" title="QTP函数">QTP函数</a><span>(1)</span>
        </li>
        <li>
            <a href="/alinaxz/article/details/7091157" title="Java6 WebService客户端封装 (服务器动态ip)">Java6 WebService客户端封装 (服务器动态ip)</a><span>(1)</span>
        </li>
    </ul>
</div>
<div id="homepageArticles" class="panel">
    <ul class="panel_head"><span>推荐文章</span></ul>
    <ul class="panel_body" id="ad_commend">
    </ul>
</div>
<script type="text/javascript">
    new Ad(12, 'ad_commend');
</script><div id="newcomments" class="panel">
<ul class="panel_head"><span>最新评论</span></ul>
<ul class="panel_body itemlist">
    <li>
    <a href="/Alinaxz/article/details/6900012#comments">Announcement: [Flash]Oracle EBS二次开发系列视频教程【已放出16个视频】</a>
    <p style="margin:0px;"><a href="/cl529675227" class="user_name">cl529675227</a>:
进去网址不能下载，要登陆。但那个网址好像没有注册用户的连接。
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/2025589#comments">ora-00932:数据类型不一致:应为 -,但却获得BLOB</a>
    <p style="margin:0px;"><a href="/dandongsoft" class="user_name">dandongsoft</a>:
没明白呀啊   啊
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/4038714#comments">ORACLE数据库中PARTITION的用法</a>
    <p style="margin:0px;"><a href="/a445454545" class="user_name">a445454545</a>:
alter table DCD_FACTOR_CURVE add  partition       ...
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/6804818#comments">MyEclipse6.5上基于JAX-WS开发Webservice</a>
    <p style="margin:0px;"><a href="/Wy125349372" class="user_name">Wy125349372</a>:
哈哈,对我有帮助..
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/6804821#comments">JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI ...解决</a>
    <p style="margin:0px;"><a href="/suimenghuashi" class="user_name">suimenghuashi</a>:
谢了，其他人复制黏贴的方法都不管用
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/7091157#comments">Java6 WebService客户端封装 (服务器动态ip)</a>
    <p style="margin:0px;"><a href="/zhanghaidang" class="user_name">zhanghaidang</a>:
你这错到西班牙去了呢
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/6804818#comments">MyEclipse6.5上基于JAX-WS开发Webservice</a>
    <p style="margin:0px;"><a href="/tyzr001" class="user_name">tyzr001</a>:
谢谢，很有用
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/6622912#comments">springmvc Spring3 MVC @ResponseBody返回，jquery ajax调用中文乱码问题解决</a>
    <p style="margin:0px;"><a href="/honghuixixi" class="user_name">honghuixixi</a>:
如何实现AnnotationMethodHandlerAdapter类handleResponseB...
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/6804817#comments">利用Myeclipse自动生成webService客户端代码</a>
    <p style="margin:0px;"><a href="/jie_xu" class="user_name">jie_xu</a>:
不够详细
    </p>
    </li>
    <li>
    <a href="/Alinaxz/article/details/5503214#comments">Android初学者常见问题解析（1）</a>
    <p style="margin:0px;"><a href="/oyang716" class="user_name">oyang716</a>:
好棒，初学者救星！
    </p>
    </li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>

<div class="clear"></div>
</div>

<script type="text/javascript" src="http://static.blog.csdn.net/scripts/newblog.min.js?v=1.1"></script>
<script type="text/javascript" src="http://medal.blog.csdn.net/showblogmedal.ashx?blogid=191743"></script>

<script type="text/javascript" src="http://csdnimg.cn/pubfooter/js/publib_footer.js"></script>

<script type="text/javascript" src="http://passport.csdn.net/content/loginbox/login.js"></script>
<script type="text/javascript">document.write("<img src=http://counter.csdn.net/pv.aspx?id=24 border=0 width=0 height=0>");</script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/Csdn/counter.js"></script>


<script type="text/javascript" src="http://ad.csdn.net/scripts/ad-blog.js"></script>
</div>
</body>
</html>